package com.xiangyang.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

@Data
@SuperBuilder
@TableName(value = "post")
@NoArgsConstructor
@AllArgsConstructor
public class Post extends BaseEntity {
 @TableId(value = "post_id", type = IdType.AUTO)
    private Long postId;   // 岗位id
    private String postName; // 岗位名称
    private Integer postCode;  // 岗位编码
    private String postStatus; // 岗位状态
    private String createTime; // 创建时间

    // 重写 BaseEntity 的 getId 和 setId 方法
    @Override
    public Long getId() {
        return getPostId();
    }

    @Override
    public void setId(Long id) {
        setPostId(id);
    }



    public void setPostId(Long postId) {
        this.postId = postId;
        // 同步设置 BaseEntity 的 id
        super.setId(postId);
    }
}